home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20031118-20041115
/
000371_fdc@columbia.edu_Wed Aug 25 12:30:29 2004.msg
< prev
next >
Wrap
Internet Message Format
|
2004-11-14
|
2KB
Path: newsmaster.cc.columbia.edu!not-for-mail
From: Frank da Cruz <fdc@columbia.edu>
Newsgroups: comp.protocols.kermit.misc
Subject: Re: input/minput commands
Date: 25 Aug 2004 16:30:13 GMT
Organization: Columbia University
Lines: 33
Message-ID: <slrncipfkl.3rc.fdc@sesame.cc.columbia.edu>
References: <cgi8mi$d1r$1@avnika.corp.mot.com>
Reply-To: fdc@columbia.edu
NNTP-Posting-Host: sesame.cc.columbia.edu
X-Trace: newsmaster.cc.columbia.edu 1093451413 28977 128.59.59.56 (25 Aug 2004 16:30:13 GMT)
X-Complaints-To: postmaster@columbia.edu
NNTP-Posting-Date: 25 Aug 2004 16:30:13 GMT
User-Agent: slrn/0.9.8.0 (SunOS)
Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:15136
On 2004-08-25, Ken V. Broezell {QMCS11} <broezell@cig.mot.com> wrote:
: Is there a way to get the input/minput command to find an exact match?
:
: I want it to find only the string:
:
: login:
:
: That's a single space followed by login: and no trailing spaces. Using
: the UNIX grep command I would find it using:
:
: grep '^ login:$' file_name
:
: Instead, input/minput is catching any line with login: within it, such as:
:
: Last login: Tue Aug 17 16:03:20 from 10.195.10.8
:
The grep-like pattern mentioned in a previous response to this posting might
do the job, but to be perfectly accurate and precise, you have to take time
into account. What you probably should be looking for is a carriage return,
a linefeed, a space, the string "login:" (or maybe it should be "login: "?),
and then check that nothing else follows within a certain amount of time.
You could do it like this:
input 20 "\13\10 login:"
if failure { (handle failure) }
input 5
if success { (handle failure) }
(handle success)
"input 5" means "wait up to 5 seconds for any character to arrive". Thus
if it succeeds, you do not have the login prompt you were looking for.
- Frank